<?php
/**
 * 招聘信息管理类
 * comfiger
 * 2016-8-28
 **/
namespace Mama\Model;
use Think\Model;
class RecruitModel extends Model{
	//定义表名称
	protected $tableName = 'recruit';
	
	public function getRecruitCount($where=array()){
		return $this->where($where)->count();
	}

	public function getRecruitList($page, $where=array()){
		return $this->where($where)
					->order('id asc')
					->page($page, C('PAGE_SIZE'))
					->select();
	}
	
	/**
	 * 发布新闻
	 **/
	public function addRecruitInfo($data){
		return $this->data($data)->add();
	}
	
	/**
	 * 编辑新闻
	 **/
	public function editResruitInfo($id, $data){
		return $this->where(array('id' => $id))->setField($data);
	}
	
	public function getRecruitInfo($id){
		return $this->where(array('id' => $id))->find();
	}
}